package com.yuxi.pubInter;



import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import com.yuxi.common.SkJsonResult;
import com.yuxi.pubInter.baseVO.AbstractDataVO;
import com.yuxi.pubInter.baseVO.AbstractPageVO;
import com.yuxi.pubInter.exception.BusinessException;
import com.yuxi.pubInter.exception.SkException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.validation.Valid;

/**
 * @author xy
 * @Date 2019-12-09 15:25:28
 * @description 只查询继承这个类
 */

public abstract class ReadRestfulController<DTO extends AbstractDTO
        , PageDTO extends AbstractPageDTO
        , T extends BaseIdDoMain<KeyType>
        , TS extends BaseSearch
        , DomainVO extends AbstractDomainVO<KeyType>
        , DetailDomainVO extends DomainVO
        , DataVO extends AbstractDataVO<DetailDomainVO>
        , ListVO extends AbstractPageVO<DetailDomainVO>
        ,KeyType> extends RestfulController<DTO, PageDTO, T, TS, DomainVO, DetailDomainVO, DataVO, ListVO,KeyType> {


    @Override
    public SkJsonResult<DataVO> postAdd(@RequestBody @Valid DTO dto, HttpServletRequest request, HttpSession session) throws SkException {
        throw new BusinessException("非法操作");
    }

    @Override
    public SkJsonResult<DataVO> postMod(@ApiParam("id") @PathVariable("id") KeyType id, @RequestBody @Valid DTO dto,   HttpServletRequest request,   HttpSession session) throws SkException {
        throw new BusinessException("非法操作");
    }

    @Override
    public SkJsonResult postDelete(@ApiParam("id") @PathVariable("id") KeyType id,   HttpServletRequest request,   HttpSession session) throws SkException {
        throw new BusinessException("非法操作");
    }

    @Override
    public SkJsonResult postDeleteAll(@RequestBody IdsDTO dto,   HttpServletRequest request,   HttpSession session) throws SkException {
        throw new BusinessException("非法操作");
    }
}